import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
  },
  {
    path: "/home",
    name: "home",
    component: () => import("../views/home.vue"),
  },
  {
    path: "/surdes/list",
    name: "我的问卷",
    component: () => import("../views/survey/list.vue"),
  },
  {
    path: "/surdes/recycle",
    name: "回收站",
    component: () => import("../views/survey/recycle/recycle.vue"),
  },
  {
    path: "/surdes/design",
    name: "问卷设计",
    component: () => import("../views/survey/design.vue"),
  },
  {
    path: "/preview/:id", 
    name: "问卷预览",
    component: () => import("../views/survey/preview.vue"),
  },
  {
    path: "/collect/:id", 
    name: "问卷收集",
    component: () => import("../views/survey/collect.vue"),
  },
  {
    path: "/collect/complete", 
    name: "采集完成",
    component: () => import("../views/survey/complete.vue"),
  },
  {
    path: "/analysis/survey1", 
    name: "问卷分析",
    component: () => import("../views/analysis/survey.vue"),
  },
  {
    path: "/analysis/detail/:id", 
    name: "数据详情",
    component: () => import("../views/analysis/data_detail.vue"),
  },
  {
    path: "/dict/list", 
    name: "字典列表",
    component: () => import("../views/dict/list.vue"),
  },
  {
    path: "/template/list", 
    name: "共享模板",
    component: () => import("../views/template/list.vue"),
  },
  {
    path: "/user/center", 
    name: "个人中心",
    component: () => import("../views/user/center.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
});

export default router;
